From: Florian Müllner Date: Sun, 6 Nov 2022 12:06:44 +0000 (+0100) Subject: screenshot: Cache ScreencastSupported property X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~405^2^2~272 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=144daf200c12f313c2cc7c01daef9e26e396a328;p=gnome-shell.git screenshot: Cache ScreencastSupported property The screencast service shuts down when not in use, so it is almost certainly not running when handling the screencast shortcut. Instead of making sure the service is restarted, just cache the property when initializing the proxy. Part-of: --- diff --git a/js/ui/screenshot.js b/js/ui/screenshot.js index a01fbe3c9..b2ea6fad2 100644 --- a/js/ui/screenshot.js +++ b/js/ui/screenshot.js @@ -1017,6 +1017,7 @@ var ScreenshotUI = GObject.registerClass({ }); this._screencastInProgress = false; + this._screencastSupported = false; this._screencastProxy = new ScreencastProxy( Gio.DBus.session, @@ -1028,7 +1029,8 @@ var ScreenshotUI = GObject.registerClass({ return; } - this._castButton.visible = this._screencastProxy.ScreencastSupported; + this._screencastSupported = this._screencastProxy.ScreencastSupported; + this._castButton.visible = this._screencastSupported; }); this._lockdownSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' }); @@ -1450,7 +1452,7 @@ var ScreenshotUI = GObject.registerClass({ if (this._screencastInProgress) return; - if (mode === UIMode.SCREENCAST && !this._screencastProxy.ScreencastSupported) + if (mode === UIMode.SCREENCAST && !this._screencastSupported) return; this._castButton.checked = mode === UIMode.SCREENCAST;